function deepClone(obj) {
    return new Promise((resolve) => {
        const { port1, port2 } = new MessageChannel()
        port1.postMessage(obj)
        port2.onmessage = (e) => {
            resolve(e.data)
        }
    })
}
let obj = {
    a: 1,
    b: 2,
    c: {
        d: 3,
    }
}
deepClone(obj).then(res => {
    res.c.d = 5
    console.log(res)
})
console.log(obj)



